package com.xbongbong.saas.model;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.saas.domain.entity.WorkOrderTemplateCategoryEntity;

import java.util.List;
import java.util.Map;
/**
 *
 * @author 魏荣杰
 * @date 2019/3/5 14:32
 * @since v1.0
 * @version v1.0
 */
public interface WorkOrderTemplateCategoryModel extends IModel<WorkOrderTemplateCategoryEntity> {
    @Override
    Integer insert(WorkOrderTemplateCategoryEntity entity) throws XbbException;

    @Override
    Integer update(WorkOrderTemplateCategoryEntity entity) throws XbbException;

    @Override
    List<WorkOrderTemplateCategoryEntity> findEntitys(Map<String, Object> param);

    @Override
    Integer getEntitysCount(Map<String, Object> param);

    Integer save(WorkOrderTemplateCategoryEntity entity) throws XbbException;

    WorkOrderTemplateCategoryEntity getByKey(Long key, String corpid);

    Integer sortCategory(Map<String, Object> param, Map<Long, Long> sortMap);

    Integer deleteBykey(Long key, String corpid);

    /**
     * 获取工单模板分类list
     * @param corpid 公司id
     * @return java.util.List<com.xbongbong.saas.domain.entity.WorkOrderTemplateCategoryEntity>
     * @author zcp
     * @date 2019/7/9 19:44
     * @since v1.0
     * @version v1.0
     */
    List<WorkOrderTemplateCategoryEntity> getTemplateCategoryList(String corpid);

    /**
     * 构建工单模板分类id-分类名称的关系map
     * @param corpid 公司id
     * @return java.util.Map<java.lang.String,java.lang.String>
     * @author zcp
     * @date 2019/7/9 19:45
     * @since v1.0
     * @version v1.0
     */
    Map<String, String> getIdNameMap(String corpid);

    /**
     * 批量修改工单分类
     * @param entities
     * @param corpid
     * @return
     */
    Integer updateBatch(List<WorkOrderTemplateCategoryEntity> entities,String corpid);

    /**
     * 批量插入实体
     * @param list
     * @return 返回数据的列表
     */
    List<WorkOrderTemplateCategoryEntity> insertBatch(List<WorkOrderTemplateCategoryEntity> list);

}
